package API.DAY3.collection;

import java.util.Collection;
import java.util.HashSet;
//contains()是否包含,remove()删除
public class CollectionDemo2 {
    public static void main(String[] args) {
//        Collection a = new ArrayList();
        Collection a = new HashSet();
        a.add(new Point(1,2));
        a.add(new Point(3,4));
        a.add(new Point(5,6));
        a.add(new Point(7,8));
        boolean b = a.add(new Point(1,2));
        System.out.println(b);
        System.out.println(a);

        Point x = new Point(1,2);
        boolean c = a.contains(x);
        System.out.println(c);

        boolean d = a.remove(x);
        System.out.println(d);
        System.out.println(a);
    }
}
